﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
  <class name="FastSpring.Core.Model.PagerList,FastSpring.Net.Core" table="Sys_PagerList" lazy="false">
    <id name="ID" column="ID" type="Int32">
      <generator class="native" />
    </id>
    <property name="PagerSign" column="PagerSign"/>
    <property name="PageName" column="PageName"/>
    <property name="KeyName" column="KeyName"/>
    <property name="ClassAll" column="ClassAll"/>
    <property name="ClassPackage" column="ClassPackage"/>
    <property name="IsChild" column="IsChild"/>
    <property name="ParentKeyName" column="ParentKeyName"/>
    <property name="IsSearch" column="IsSearch"/>
    <property name="SearchName" column="SearchName"/>
    <property name="ListPagerID" column="ListPagerID"/>
    <property name="IncludeWebControls" column="IncludeWebControls"/>
    <property name="IncludeSessions" column="IncludeSessions"/>
    <property name="IncludeParameters" column="IncludeParameters"/>
    <property name="Records" column="Records"/>
    <property name="IsInitSearch" column="IsInitSearch"/>
    <property name="IsView" column="IsView"/>
    <property name="IsCreateUpdate" column="IsCreateUpdate"/>
    <property name="IsButtonNew" column="IsButtonNew"/>
    <property name="IsButtonView" column="IsButtonView"/>
    <property name="IsButtonUpdate" column="IsButtonUpdate"/>
    <property name="IsButtonDelete" column="IsButtonDelete"/>
    <property name="IsButtonOut" column="IsButtonOut"/>
    <property name="IsButtonOutAll" column="IsButtonOutAll"/>
    <property name="IsButtonCopy" column="IsButtonCopy"/>
    <property name="IsEntityBeforeAndAfterProcess" column="IsEntityBeforeAndAfterProcess"/>
    <property name="EntityBeforeAndAfterProcess" column="EntityBeforeAndAfterProcess"/>
    <property name="PageModule" column="PageModule"/>
    <property name="IsDeleteDepend" column="IsDeleteDepend"/>
    <property name="DeleteDepend" column="DeleteDepend"/>
    <property name="PagerDesc" column="PagerDesc"/>
    <property name="IsActive" column="IsActive"/>
    <property name="IsDevelopPage" column="IsDevelopPage"/>
    <bag name="SubSearchFields" cascade="none" inverse="true" lazy="false" order-by="OrdNum" where="TableID=1 AND IsActive=1">
      <key column="PagerID"/>
      <one-to-many class="FastSpring.Core.Model.PagerListField,FastSpring.Net.Core" />
    </bag>
    <bag name="SubListFields" cascade="none" inverse="true" lazy="false" order-by="OrdNum" where="TableID=2 AND IsActive=1">
      <key column="PagerID"/>
      <one-to-many class="FastSpring.Core.Model.PagerListField,FastSpring.Net.Core" />
    </bag>
    <bag name="SubUpdateFields" cascade="none" inverse="true" lazy="false" order-by="OrdNum" where="TableID=3 AND IsActive=1">
      <key column="PagerID"/>
      <one-to-many class="FastSpring.Core.Model.PagerListField,FastSpring.Net.Core" />
    </bag>
    <bag name="SubViewFields" cascade="none" inverse="true" lazy="false" order-by="OrdNum" where="TableID=4 AND IsActive=1">
      <key column="PagerID"/>
      <one-to-many class="FastSpring.Core.Model.PagerListField,FastSpring.Net.Core" />
    </bag>
    <bag name="SubButtons" cascade="none" inverse="true" lazy="false" order-by="OrdNum" where="IsActive=1">
      <key column="PagerID"/>
      <one-to-many class="FastSpring.Core.Model.PagerListButton,FastSpring.Net.Core" />
    </bag>
  </class>
  <class name="FastSpring.Core.Model.PagerListField,FastSpring.Net.Core" table="Sys_PagerListField" lazy="false">
    <id name="ID" column="ID" type="Int32">
      <generator class="native" />
    </id>
    <property name="PagerID" column="PagerID"/>
    <property name="TableID" column="TableID"/>
    <property name="FieldControlID" column="FieldControlID"/>
    <property name="FieldName" column="FieldName"/>
    <property name="FieldClassName" column="FieldClassName"/>
    <property name="FieldTypeClass" column="FieldTypeClass"/>
    <property name="FieldTypeView" column="FieldTypeView"/>
    <property name="FieldTypeValue" column="FieldTypeValue"/>
    <property name="FieldValueDefault" column="FieldValueDefault"/>
    <property name="IsParent" column="IsParent"/>
    <property name="ParentName" column="ParentName"/>
    <property name="ParentClassAll" column="ParentClassAll"/>
    <property name="ListType" column="ListType"/>
    <property name="ListSearchName" column="ListSearchName"/>
    <property name="ListSearchParam" column="ListSearchParam"/>
    <property name="IsHidden" column="IsHidden"/>
    <property name="OrdNum" column="OrdNum"/>
    <property name="IsEdit" column="IsEdit"/>
    <property name="IsUpdate" column="IsUpdate"/>
    <property name="IsNotNull" column="IsNotNull"/>
    <property name="IsUnique" column="IsUnique"/>
    <property name="UniqueSearchName" column="UniqueSearchName"/>
    <property name="SiteView" column="SiteView"/>
    <property name="SiteReal" column="SiteReal"/>
    <property name="ShowLabel" column="ShowLabel"/>
    <property name="FieldDesc" column="FieldDesc"/>
    <property name="IsObjectProp" column="IsObjectProp"/>
    <property name="IsShow" column="IsShow"/>
    <property name="IsActive" column="IsActive"/>
  </class>
  <class name="FastSpring.Core.Model.PagerListButton,FastSpring.Net.Core" table="Sys_PagerListButton" lazy="false">
    <id name="ID" column="ID" type="Int32">
      <generator class="native" />
    </id>
    <property name="PagerID" column="PagerID"/>
    <property name="ButtonName" column="ButtonName"/>
    <property name="ButtonAlert" column="ButtonAlert"/>
    <property name="ButtonType" column="ButtonType"/>
    <property name="ButtonTarget" column="ButtonTarget"/>
    <property name="IsSingleRecord" column="IsSingleRecord"/>
    <property name="IsButtonProcessBefore" column="IsButtonProcessBefore"/>
    <property name="ButtonProcessBefore" column="ButtonProcessBefore"/>
    <property name="ButtonProcess" column="ButtonProcess"/>
    <property name="IsButtonProcessAfter" column="IsButtonProcessAfter"/>
    <property name="ButtonProcessAfter" column="ButtonProcessAfter"/>
    <property name="PageModule" column="PageModule"/>
    <property name="ButtonDesc" column="ButtonDesc"/>
    <property name="OrdNum" column="OrdNum"/>
    <property name="CreateDate" column="CreateDate"/>
    <property name="IsActive" column="IsActive"/>
  </class>
  <query name="GetPagerListAll">
    <![CDATA[from PagerList pagerList WHERE pagerList.IsActive=1 ORDER BY pagerList.ID]]>
  </query>
  <query name="GetPagerListsList">
    <![CDATA[Select pagerList.PageName,pagerList.ID from PagerList pagerList ORDER BY pagerList.ID]]>
  </query>
  <!-- 删除页面时检查 -->
  <query name="GetPagerListFieldsOfPagerID">
    <![CDATA[from PagerListField pagerListField WHERE pagerListField.PagerID=:ParentID]]>
  </query>
  <query name="GetPagerListButtonsOfPagerID">
    <![CDATA[from PagerListButton pagerListButton WHERE pagerListButton.PagerID=:ParentID]]>
  </query>

  <!-- PagerList 的 PagerSign 重新性检查 -->
  <query name="GetPagerListOfPagerSign">
    <![CDATA[from PagerList pagerList WHERE pagerList.PagerSign=:param1]]>
  </query>
</hibernate-mapping>

